// Package mycache
// @Author: zhangdi
// @File: ini
// @Version: 1.0.0
// @Date: 2023/7/25 10:52
package mycache

import (
	"github.com/patrickmn/go-cache"
	"time"
)

var c *cache.Cache

func init() {
	// 设置超时时间和清理时间

	c = cache.New(5*time.Minute, 10*time.Minute)
}

func GetString(k string) string {
	r, ok := c.Get(k)
	if !ok {
		return ""
	}
	return r.(string)
}

func SetString(k string, v string, d time.Duration) {
	c.Set(k, v, d)
}
